package com.zp.kidshop.common.util;

/**
 * 
 * @Title: Ascall.java
 * @Package com.minghang.common.utils 
 * @Description: 加密和解密
 * @author 张鹏  
 * @date 2017年2月16日 下午3:09:58 
 * @version V1.0
 */
public class Ascall {
	public static String decoder(String strDecrypt) {
		String[] split = strDecrypt.toString().split("A");
		StringBuffer s = new StringBuffer("");
		for (String string2 : split) {
			s.append((char) Integer.parseInt(string2));
		}
		return s.toString();
	}

	public static String encoder(String str) {
		char[] charArray = str.toCharArray();
		StringBuffer buf = new StringBuffer();
		for (int i = 0; i < charArray.length; i++) {
			buf.append((int) charArray[i] + "A");
		}
		buf.delete(buf.length() - 1, buf.length());
		return buf.toString();

	}
	
	public static void main(String[] args) {
		String aa = "哈哈";
		System.out.println(encoder(aa));
		String bb = encoder(aa);
		System.out.println(decoder(bb));
	}
}
